#include <iostream>
#include <algorithm> 

#define MAX_C 5000

using namespace std;

int main() {
	int N, S, c, y, min_cost_now, res = 0;
    min_cost_now = MAX_C;
    res = 0;
    
    cin >> N >> S;
    for(int i = 0; i < N; i++){
    	cin >> c >> y;
    	min_cost_now = min(c, min_cost_now + S);
    	
    	res += min_cost_now * y;
	}
	
	cout << res << endl;
    return 0;
}
